package com.wms.controller;

import com.wms.entity.Warehouse;
import com.wms.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

@RestController
@RequestMapping("/warehouse")
public class WarehouseController {

    @Autowired
    private WarehouseService warehouseService;

    @GetMapping("/all")
    public List<Warehouse> getAllWarehouses() {
        return warehouseService.getAllWarehouses();
    }

    @PostMapping("/entry")
    public void addEntry(@RequestParam Integer companyId, @RequestParam Integer totalItems) {
        warehouseService.addEntry(companyId, totalItems);
    }

    @PostMapping("/exit")
    public void addExit(@RequestParam Integer companyId, @RequestParam Integer totalItems) {
        warehouseService.addExit(companyId,totalItems);
    }
}
